<%@ page language="java" pageEncoding="us-ascii" contentType="text/html;charset=us-ascii" %>
<%--Copyright (C) 2011 Wolfgang Hankeln, Norma J. Wendel
	 
	This file is part of CDinFusion.
	
	CDinFusion is free software: you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public 
	License in version 3 (LGPL3) as published by the Free Software
	Foundation version 3 of the License.
	
	CDinFusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	Lesser General Public License for more details.
	
	You should have received a copy of the Lesser General Public
	License along with CDinFusion; see the file COPYING. If not,
	write to the Free Software Foundation, 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA or see <http://www.gnu.org/licenses/>.
	
	If you have any questions, send an email to: megx@mpi-bremen.de.
--%>
<%@ page import="org.cdinfusion.data.*"%>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Arrays" %>
<%System.out.println("<<<<<<<<<<cd_changes_in_x>>>>>>>>>>");%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
</style>
<title>GROUP SELECTION FOR CD CHANGES</title>
</head>
<body>
<table border="0" width="100%" bgcolor="#2B3990" cellpadding=0 cellspacing=0>
<tr bgcolor="#ffffff">
<td width=250>
<center>
<img height="81" width="250" alt="CDinFusion Logo" src="/CDinFusion/img/logo_small_dark.png">
</center>
</td>
</tr>

<tr align="left">    
<td>
<jsp:include page="documentation/navigation.jsp"></jsp:include>
</td>
</tr>

<tr bgcolor="#ffffff">
<td>
<div class="center_div">    
<%
String origin = (String) session.getAttribute("origin");
String context_exists = (String) session.getAttribute("context_exists");

List<CDElement> cdeLIST = (List<CDElement>) session.getAttribute("cdeLIST");
List<String> allSequenceIDs = (List<String>) session.getAttribute("allSequenceIDs");

String sessionID = session.getId();

origin = "cd_change";
session.setAttribute("origin", origin);
int seq_num = 10;
int size = allSequenceIDs.size();// split.length;
CDElement cdelement = null;
String env = "";
String study = "";
%>
<center>Do you want to change the contextual data entries?</center>
<p>Please select one group, after your change, this page will show up, you are done (finish).</p>
<form action="cd_change.htm" method="POST">
	<%System.out.println("destination: cd_change.htm");%>
	<p>Are you done with all changes? <input class="submitbutton" type="submit" name="submit" value="finish"></p>
	<table>
			<tr>
				<td>change something?</td>			
				<td>group ID</td>
				<td>seqID: from x to y</td>
				<td>studytype</td>
				<td>envtype</td>
			</tr>
			<%
			for(int i = 0; i < cdeLIST.size(); i++){
				cdelement = cdeLIST.get(i);
				study = cdelement.getStudy().getClass().toString().toLowerCase().substring(36);
				env = cdelement.getEnv().getClass().toString().toLowerCase().substring(38);
				%>
				<tr>
					<td><input type="radio" name="cSeqID" value="<%=i%>"></td>
					<td><%=i+1%></td>		
					<td>from: <%=cdelement.getFirstSequenceID()%>
						<br> to: <%=cdelement.getLastSequenceID()%>
					</td>
					<td><%if(study.equals("mimarks_s")) out.print("MIMARKS survey");
					if(study.equals("mimarks_c")) out.print("MIMARKS culture");
					if(study.equals("eu")) out.print("MIGS eukaryotes");
					if(study.equals("ba")) out.print("MIGS bacteria and archaea");
					if(study.equals("pl")) out.print("MIGS plasmid");
					if(study.equals("vi")) out.print("MIGS virus");
					if(study.equals("orga")) out.print("MIGS organelle");
					if(study.equals("me")) out.print("MIMS metagenome");
					%></td>
					<td><%if(env.equals("water")) out.print("water");
					if(env.equals("wastewater")) out.print("wastewater/sludge");
					if(env.equals("soil")) out.print("soil");
					if(env.equals("sediment")) out.print("sediment");
					if(env.equals("plant_associated")) out.print("plant-associated");
					if(env.equals("miscellaneous")) out.print("miscellaneous");
					if(env.equals("biofilm")) out.print("biofilm");
					if(env.equals("human_vaginal")) out.print("human-vaginal");
					if(env.equals("human_skin")) out.print("human-skin");
					if(env.equals("human_oral")) out.print("human-oral");
					if(env.equals("human_gut")) out.print("human-gut");
					if(env.equals("human_associated")) out.print("human-associated");
					if(env.equals("host_associated")) out.print("host-associated");
					if(env.equals("air")) out.print("air");
					%></td>
			</tr>
				<%
			}//end for%>
	</table>
	<br>
	<center><input class="submitbutton" type="submit" name="submit" value="proceed"></center>
</form>
</div>
</td>
</tr>
<tr bgcolor="#ffffff"><td align="right" height=30>
	<img height="20" width="200" alt="CDinFusion Step 3" src="/CDinFusion/img/step3.png">
</td></tr>
<jsp:include page="documentation/bottom_info.jsp"></jsp:include>
</table>
</body>
</html>